package com.zw.cloud.tools.controller;

import com.zw.cloud.tools.utils.OpenAiUtils;
import lombok.extern.slf4j.Slf4j;
import org.devlive.sdk.openai.entity.MessageEntity;
import org.springframework.web.bind.annotation.*;

import java.util.List;

@RestController
@RequestMapping("/chatGPT")
@Slf4j
public class OpenAiController {

    //http://localhost:9040/chatGPT?text=true&prompt=
    public List<MessageEntity> getAiResult(@RequestParam String content) {
        return OpenAiUtils.getAiResult(content);
    }

}
